package com.example.noteapp.HomePager;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import com.example.noteapp.Adapter.NoteAdapter;
import com.example.noteapp.Entity.EntityNoteCard;
import com.example.noteapp.R;
import com.example.noteapp.databinding.FragmentNoteBinding;

import java.util.ArrayList;

public class NoteFragment extends Fragment {
    FragmentNoteBinding binding;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        binding = FragmentNoteBinding.inflate(getLayoutInflater());
        ArrayList<EntityNoteCard> list = new ArrayList<>();
        list.add(new EntityNoteCard(1,"liliping","liliping",null,"hhwwc","tilte",getString(R.string.item_content),getString(R.string.item_time)));
        list.add(new EntityNoteCard(1,"liliping","liliping",null,"hhwwc","tilte",getString(R.string.item_content),getString(R.string.item_time)));
        list.add(new EntityNoteCard(1,"liliping","liliping",null,"hhwwc","tilte",getString(R.string.item_content),getString(R.string.item_time)));
        list.add(new EntityNoteCard(1,"liliping","liliping",null,"hhwwc","tilte",getString(R.string.item_content),getString(R.string.item_time)));
        NoteAdapter noteAdapter = new NoteAdapter(list,getContext());
        binding.noteList.setAdapter(noteAdapter);
        binding.noteList.setLayoutManager(new LinearLayoutManager(getContext(),LinearLayoutManager.VERTICAL,false));
        return binding.getRoot();
    }

}